import time

from django.db import models


# Create your models here.


# 普通用户表
class User(models.Model):
    email = models.CharField(max_length=30, null=False)
    password = models.CharField(max_length=255)
    nickname = models.CharField(max_length=30)

    class Meta:
        db_table = 'user'


# 验证码存储表
class ValidCode(models.Model):
    email = models.CharField(max_length=60)
    code = models.CharField(max_length=60)
    losetime = models.DecimalField(
        decimal_places=8,
        max_digits=20,
        default=time.time() + 300
    )

    class Meta:
        db_table = 'validcode'

